<extend name="Public/base"/>
<block name="body">
    <div class="page-crumb">
        <div class="ui-ctrl ui-crumb"><span class="ui-crumb-node ui-crumb-node-first ui-crumb-node-last">订单管理</span></div>
    </div>

    <div class="layui-main">
        <div class="list-meta">
            <div class="list-action">
                <a class="ui-link skin-add-link" href="javascript:;" onclick="PopModel.openFrame('/AdOrder/add');" target="">新建订单</a>
            </div>
            <div class="list-filter">
            </div>

        </div>

        <!-- 数据列表 -->
        <table class="layui-table list-content-table" lay-skin="nob">
            <colgroup>
				<col width="20">
                <col width="150">
                <col width="100">
                <col width="200">
                <col width="200">
                <col width="100">
                <col width="250">
                <col width="200">
                <col width="200">
            </colgroup>
            <thead class="list-table-head">
            <tr>
				<th class="ui-table-hcell">
					<div class="ui-table-hcell-text ui-table-hcell-text-first">
						<input type="checkbox" class="ui-table-select-all" data-index="">
					</div>
				</th>
                <th class="ui-table-hcell">
                    <div class="ui-table-hcell-text">名称</div>
                </th>
                <th class="ui-table-hcell">
                    <div class="ui-table-hcell-text">订单状态</div>
                </th>
                <th class="ui-table-hcell">
                    <div class="ui-table-hcell-text">广告状态</div>
                </th>
                <th class="ui-table-hcell">
                    <div class="ui-table-hcell-text">预算金额</div>
                </th>
                <th class="ui-table-hcell">
                    <div class="ui-table-hcell-text">广告客户</div>
                </th>
                <th class="ui-table-hcell">
                    <div class="ui-table-hcell-text">销售人员</div>
                </th>
                <th class="ui-table-hcell">
                    <div class="ui-table-hcell-text">投放日期</div>
                </th>

                <th class="ui-table-hcell">
                    <div class="ui-table-hcell-text">创建时间</div>
                </th>
                <th class="ui-table-hcell">
                    <div class="ui-table-hcell-text">操作</div>
                </th>
            </tr>
            </thead>

            <tbody class="list-table-body">
            <foreach name="lists" item="order">
                <tr>
					<td class="ui-table-cell">
						<div class="ui-table-cell-text">
							<input type="checkbox" class="ui-table-multi-select" data-id="{$order.id}">
						</div>
					</td>
                    <td class="ui-table-cell"><div class="ui-table-cell-text">{$order.order_name}<span class="table-content-addition">ID: {$order.id}</span></div></td>
                    <td class="ui-table-cell">
                        <div class="ui-table-cell-text">
                            <if condition="$order.order_state eq 1" >
                                <span class="table-status-activated">启用</span>
                            <elseif condition="$order.order_state eq 2" />
                                <span class="table-status-inactive">停用</span>
                            <elseif condition="$order.order_state eq 3" />
                                <span class="table-status-inactive">删除</span>
                            </if>
                        </div>
                    </td>

                    <td class="ui-table-cell">
                        <div class="ui-table-cell-text">
                            <foreach name="order.delivery" item="v" key="k" >

                                <if condition="$k eq 0">
                                    <span> <a class="table-status-inactive" href="/AdDelivery/index?ids={$v.ids}"> 待确认{$v.count} </a> </span>
                                <elseif condition="$k eq 4"/>
                                    <span> <a class="table-status-activated" href="/AdDelivery/index?ids={$v.ids}" > 投放中{$v.count} </a> </span>
                                </if>
                            </foreach>
                        </div>
                    </td>
                    <td class="ui-table-cell"><div class="ui-table-cell-text">{$order.amount}</div></td>
                    <td class="ui-table-cell"><div class="ui-table-cell-text">{$order.name}</div></td>
                    <td class="ui-table-cell"><div class="ui-table-cell-text">{$order.sale_people}</div></td>
                    <td class="ui-table-cell"><div class="ui-table-cell-text">{$order.start_time|date="Y/m/d H:i:s",###} ~ {$order.end_time|date="Y/m/d H:i:s",###}</div></td>
                    <td class="ui-table-cell"><div class="ui-table-cell-text">{$order.ctime|date="Y-m-d",###}</div></td>
                    <!--<td class="ui-table-cell">-->
                        <!--<div class="ui-table-cell-text">-->
                            <!--<if condition="$media.state eq 0">-->
                                <!--<span class="table-status-inactive">待审核</span>-->
                                <!--<elseif condition="$media.state eq 1"/>-->
                                <!--<span class="table-status-activated">已通过</span>-->
                            <!--</if>-->
                        <!--</div>-->
                    <!--</td>-->
                    <td class="ui-table-cell">
                        <div class="ui-table-cell-text">
                            <span class="table-operation" data-command="state" 	data-command-args="{$order.id}">状态</span>
                            <span class="table-operation" data-command="modify" data-command-args="{$order.id}">编辑</span>
                            <span class="table-operation" data-command="remove" data-command-args="{$order.id}">删除</span>
                        </div>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        {$page}
    </div>
	<script src="__BACKEND_STATIC__/js/AdOrder/order.js"></script>
</block>

